﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Meraz.Core.Model;
using System.IO;

namespace Meraz.Web.Models
{
    public class FileModel
    {
        public FileModel()
        {
            Files = new List<FileInfo>();
            Message = string.Empty;
        }
        public string StudyKey
        {
            get { return this.StudyKeyType.ToString(); }
            set
            {
                if (string.IsNullOrWhiteSpace(value))
                    this.StudyKeyType = StudyKeyType.Undefined;
                else
                {
                    try
                    {
                        this.StudyKeyType = (StudyKeyType)Enum.Parse(typeof(StudyKeyType), value);
                    }
                    catch
                    {
                        this.StudyKeyType = StudyKeyType.Undefined;
                    }
                }
            }
        }
        public StudyKeyType StudyKeyType{ get; set; }
        public List<FileInfo> Files { get; set; }
        public string Message { get; set; }
    }
}